hackerrank ruby array selection solution

visit shbcf.ru